package main.od;

import java.util.*;
import java.util.stream.Collectors;

public class LampTest {
    public static void main(String[] args) {
        // 20 70 30
        Scanner sc = new Scanner(System.in);
        int lightNum = sc.nextInt();
        // 获取输入的灯数量
        sc.nextLine();
        List<Integer> radius = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).boxed().collect(Collectors.toList());
        int maxLength = (lightNum - 1) * 100;
        List<List<Integer>> lampList = new ArrayList<>();
        int left;
        int right;
        for (int i = 1;i <= lightNum;i++){
            left = Math.max(0,(i - 1)*100 - radius.get(i-1));
            right = Math.min(maxLength,(i - 1)*100 + radius.get(i-1));
            List<Integer> tempList = new ArrayList<>();
            tempList.add(left);
            tempList.add(right);
            lampList.add(tempList);
        }
        lampList.sort((o1, o2) -> {
            if (Objects.equals(o1.get(0), o2.get(0))) {
                return o1.get(1) - o2.get(1);
            } else {
                return o1.get(0) - o2.get(0);
            }
        });
        int blackLength = 0;
        for (int i = 0;i < lampList.size() - 1;i++){
            List<Integer> currentLamp;
            List<Integer> nextLamp;
            currentLamp = lampList.get(i);
            nextLamp = lampList.get(i + 1);
            if (currentLamp.get(1) >= nextLamp.get(0)){
                nextLamp.set(1,Math.max(currentLamp.get(1),nextLamp.get(1)));
                continue;
            }
            blackLength += nextLamp.get(0) - currentLamp.get(1);
        }
        System.out.println(blackLength);
    }

}
